<!--
 * @Description: 
 * @Author: 杨志航<yangzhihang@372163.com>
 * @Date: 2021-12-23 11:55:45
-->
<template>
    <div>
        <TypeNav isShow="true"/>
        <ListContainer />
        <Recommend />
        <Rank />
        <Like />
        <!-- Floor这个组件：自己在组件内部是没有发请求的，数据是父组件给的 -->
        <Floor v-for="(floor, index) in floorInfo" :floor="floor" :key="index" :sort="index" />
        <Brand />

    </div>
</template>

<script>
import Brand from './Brand'

import Like from './Like'
import ListContainer from './ListContainer'
import Rank from './Rank'
import Recommend from './Recommend'
import Floor from './Floor'
import {mapState} from 'vuex'

export default {
    components:{
        Brand,
        Floor,
        Like,
        ListContainer,
        Rank,
        Recommend
    },
    mounted(){
        this.$store.dispatch("getFloorInfo")

        this.$store.dispatch("getUserInfo")
    },
    computed:{
        ...mapState({
            floorInfo:(state)=>state.home.floorInfo
        })
    }

}
</script>

<style lang="less" scoped>

</style>